package com.xiaojian.pick.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class Attention {
    private Integer id;     // 主键
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;    //

    private Topic topic;    // 关注的帖子
    private User user;  // 关注的用户

    public Attention(Integer id, Date createTime, Topic topic, User user) {
        this.id = id;
        this.createTime = createTime;
        this.topic = topic;
        this.user = user;
    }

    public Attention() {
    }

    @Override
    public String toString() {
        return "Attention{" +
                "id=" + id +
                ", createTime=" + createTime +
                ", topic=" + topic +
                ", user=" + user +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Topic getTopic() {
        return topic;
    }

    public void setTopic(Topic topic) {
        this.topic = topic;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

}